package mbcontrol;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;

import com.sun.xml.internal.bind.v2.model.core.Ref;

import model.ConnectDb;
import dao.PersistConexao;
import dao.ClientesJDBCCadastro;

public class SelectCliente {
	private ConnectDb connectdb = new ConnectDb();
	String schema = connectdb.getSchema_producao();
	String user = connectdb.getUser();
	String pass = connectdb.getPass();

	private String nmcli;

	public List<String> completeCliente(String query) {
		List<String> results = new ArrayList<String>();
		List<String> val = new ArrayList<String>();
		try {
			PersistConexao persistconexao = new PersistConexao();
			Connection conexao = persistconexao.openConecao(schema, user, pass);
			ClientesJDBCCadastro dao = new ClientesJDBCCadastro(conexao);
			val = dao.ListarClienteNome(query);
			results = val;
			persistconexao.closeConexao();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return results;
	}

	public String getNmcli() {
		return nmcli;
	}

	public void setNmcli(String nmcli) {
		this.nmcli = nmcli;
	}

}
